classes = parse_classes(trialClasses);                                                                                                                                                                                                                                                                                                                                                        
hit_step = 0.005;                                                                                                                                                                                                                                                                                                                                                                             

ntrials = length(hit_history);

switch class_history(length(class_history)),                                                                                                                                                                                                                                                                                                                                                  
    case 1,                                                                                                                                                                                                                                                                                                                                                                                   
    case 2,                                                                                                                                                                                                                                                                                                                                                                                   
            sp = adaptive_step(classes.startPosition(2), hit_history(length(hit_history)), 'hit_step', -hit_step, 'stableperf', 0.75, 'mx', 0.50, 'mn', 0.2);                                                                                                                                                                                                                                 
            ep = sp + 0.3;                                                                                                                                                                                                                                                                                                                                                                    
            fprintf(1, 'AdaptingSection: case 2, sp=%.3f, ep=%.3f\n', sp, ep);                                                                                                                                                                                                                                                                                                                
            classes.startPosition(2) = sp; classes.endPosition(2) = ep;                                                                                                                                                                                                                                                                                                                       
    case 3,                                                                                                                                                                                                                                                                                                                                                                                   
    case 4,                                                                                                                                                                                                                                                                                                                                                                                   
            sp = adaptive_step(classes.startPosition(4), hit_history(length(hit_history)), 'hit_step', hit_step, 'stableperf', 0.75, 'mx', 0.80, 'mn', 0.5);                                                                                                                                                                                                                                  
            ep = sp - 0.3;                                                                                                                                                                                                                                                                                                                                                                    
            fprintf(1, 'AdaptingSection: case 2, sp=%.3f, ep=%.3f\n', sp, ep);                                                                                                                                                                                                                                                                                                                
            classes.startPosition(4) = sp; classes.endPosition(4) = ep;                                                                                                                                                                                                                                                                                                                       
    otherwise,                                                                                                                                                                                                                                                                                                                                                                                
        warning('huh???');                                                                                                                                                                                                                                                                                                                                                                    
end;                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                              
StimulusClassesSection(obj, 'set_classes', classes);                                                                                                                                                                                                                                                                                                                                          
drawnow;                                                                                                                                                                                                                                                                                                                                                                                      
